package com.haierCamera.customapplication.ui.custom.adapter;

import java.util.List;

import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

/**
 * 项目名称 iwatchteacher
 * 创建人 lipeiyong
 * 创建时间  2019/2/26 10:38
 * 功能描述：
 */
public class CustomFragmentPageAdapter extends FragmentPagerAdapter {

    private List<Fragment> listfragment;

    public CustomFragmentPageAdapter(FragmentManager fm, List<Fragment> list) {
        super(fm);
        listfragment = list;
    }

    @Override
    public Fragment getItem(int position) {
        return listfragment.get(position);
    }

    @Override
    public int getCount() {
        return listfragment.size();
    }

    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        return listfragment.get(position).getArguments().getString("className");
    }
}
